package com.shenma2009.domain;

import com.shenma2009.utils.Result;
import com.shenma2009.vo.IdVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 12692
 * @version 1.0
 * @description: ResultResponse
 * @date 2023/4/19 15:56
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultResponse {
    private int code;
    private String msg;
    private Object data;



    public static ResultResponse SUCCESS() {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(200);
        resultResponse.setMsg("操作成功");

        return resultResponse;
    }

    public static ResultResponse SUCCESS(String msg) {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(200);
        resultResponse.setMsg(msg);

        return resultResponse;
    }

//    public static ResultResponse SUCCESS(Object data) {
//        ResultResponse resultResponse = new ResultResponse();
//        resultResponse.setCode(200);
//        resultResponse.setMsg("操作成功");
//        resultResponse.setData(data);
//
//        return resultResponse;
//    }


    public static ResultResponse success(Object data){
        return new ResultResponse(10000,"操作成功！",data);
    }
    public static ResultResponse FAILED(int code, String msg) {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(code);
        resultResponse.setMsg(msg);

        return resultResponse;
    }
}
